<template>
  <div class="all-department-container">
    <div
      v-for="(department,index) in allLookInfoList"
      :key="index"
      class="department-item-container"
    >
      <item-title :title="department.department_name">
        <template
          v-if="department.if_commit!==1&&from!=='audit'"
          slot="btn"
        >
          <el-tag type="danger">未提交</el-tag>
        </template>
      </item-title>
      <el-form
        v-if="department.if_commit==1||from==='audit'"
        ref="forms"
        :label-position="labelPosition"
        label-width="160px"
        :model="department.tem_content"
      >
        <template v-for="(item) in department.tem_content.label_info">
          <el-form-item
            :key="item.time_unix"
            :label="item.label_key+'：'"
            :prop="item.time_unix"
          >
            <span v-if="item.label_type!=='richtext'">{{ item.label_value }}</span>
            <template v-else>
              <div v-html="item.label_value" />
            </template>
          </el-form-item>
        </template>
        <el-form-item
          v-if="department.enclosure&&department.enclosure.length"
          label="附件："
        >
          <file-preview :file-list="department.enclosure" />
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    allLookInfoList: {
      type: Array,
      default: () => {}
    },
    from: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      labelPosition: 'right',
      formData: {}
    }
  },

  // 生命周期 - 创建完成（访问当前this实例）
  created() {},
  methods: {}
}
</script>
<style lang="scss" scoped>
/* @import url(); 引入css类 */
.department-item-container {
  margin-bottom: 20px;
  ::v-deep .el-form {
    p {
      margin: 0px!important;
    }
    ul {
      margin: 0px!important;
      li {
        list-style: disc!important;
      }
    }
    ol {
      margin: 0px!important;
      li {
        list-style: decimal!important;
      }
    }
    .el-form-item {
      margin-bottom: 10px;
    }
  }
}
</style>
